package web.servlet.e_api;

import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;

public class GetServletApiOfAction extends ActionSupport {
	public String execute() throws Exception {
		/*actioncontext
		 * */
		ActionContext.getContext().put("request", "request message");
		
		Map<String, Object> session = ActionContext.getContext().getSession();
		session.put("session", "session of values");

		Map<String, Object> application = ActionContext .getContext().getApplication();
		application.put("applacation", "applacation messages");
		//servletactioncontext
		HttpServletRequest request = ServletActionContext.getRequest();
		HttpSession session2 = request.getSession();
		HttpServletResponse response = ServletActionContext.getResponse();
		ServletContext servletContext = ServletActionContext.getServletContext();
		
		return SUCCESS;
	}
}
